<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=request.getContextPath()%>/">
    <title></title>
    <link rel="stylesheet" type="text/css" href="Styles/base.css" />
    <link rel="stylesheet" type="text/css" href="Styles/admin-all.css" />
    <link rel="stylesheet" type="text/css" href="Styles/bootstrap.min.css" />
    <script type="text/javascript" src="Scripts/jquery-1.7.2.js"></script>
    <link rel="stylesheet" type="text/css" href="Styles/login.css" />
    <script type="text/javascript" src="Scripts/jquery-ui-1.8.22.custom.min.js"></script>
    <link rel="stylesheet" type="text/css" href="Styles/ui-lightness/jquery-ui-1.8.22.custom.css" />
    <script type="text/javascript" src="Scripts/ChurAlert.min.js?skin=blue"></script>
   
    <script type="text/javascript">
    $(function () {
        $('#am').click(function () {
            if ($('#uid').val() == "" || $('#pwd').val() == "" || $('#code').val() == "") { $('.tips').html('工号或密码不可为空！') }
            else {
                $.post("check/daka",{
                	username:$('#uid').val(),
                	password:$('#pwd').val()
                },function(data){
                	if(data=="sucess"){
   					$.post("jixiao/am",{
   						empNum:$('#uid').val()
   					},function(data){
   						if(data==1){
   			                alert("打卡成功")
   			             location.href = 'jixiao/daka'
   						}else{
   							alert("已打过上班卡")
   						 location.href = 'jixiao/daka'
   						}
   					})
                	}else{
                		$('.tips').html('工号或密码错误！')
                	}
                })
            }
        })
        
        $('#pm').click(function () {
            if ($('#uid').val() == "" || $('#pwd').val() == "" || $('#code').val() == "") { $('.tips').html('工号或密码不可为空！') }
            else {
                $.post("check/daka",{
                	username:$('#uid').val(),
                	password:$('#pwd').val()
                },function(data){
                	if(data=="sucess"){
   					$.post("jixiao/pm",{
   						empNum:$('#uid').val()
   					},function(data){
   						if(data==1){
   			                alert("打卡成功")
   			             location.href = 'jixiao/daka'
   						}
   					})
                	}else{
                		$('.tips').html('工号或密码错误！')
                	}
                })
            }
        })
    })
    </script>
</head>
<body>
    <div class="alert alert-info">当前位置<b class="tip"></b>绩效管理<b class="tip"></b>考勤打卡</div>
    <div class="row-fluid">
        <h1>考勤打卡</h1>
        <p>
            <label>工&nbsp;&nbsp;&nbsp;号：<input type="text" id="uid" /></label>
        </p>
        <p>
            <label>密&nbsp;&nbsp;&nbsp;码：<input type="password" id="pwd" /></label>
        </p>
       
        <p class="tips" style="color:red">&nbsp;</p>
        <hr />
        <input type="button" value=" 上班卡 " class="btn btn-primary btn-large login" id="am" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 下班卡 " class="btn btn-large" id="pm"/>
    </div>
    
</body>
</html>